//package com.zxy.furns.web;/**
// * ClassName: LoginServlet
// * Package: com.zxy.furns.web
// *
// * @Author zxy
// * @Create 2025/3/20 22:38
// * @Version 1.0
// * title:
// * Description:
// */
//
//import com.zxy.furns.entity.Member;
//import com.zxy.furns.service.MemberService;
//import com.zxy.furns.service.impl.MemberServiceImpl;
//
//import javax.servlet.*;
//import javax.servlet.http.*;
//import javax.servlet.annotation.WebServlet;
//import java.io.IOException;
//
//@WebServlet("/loginServlet")
//public class LoginServlet extends HttpServlet {
//    private MemberService memberService = new MemberServiceImpl();
//
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        doPost(req, resp);
//    }
//
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        System.out.println("LoginServlet被调用了...");
//        String username = req.getParameter("username");
//        String password = req.getParameter("password");
//
//        Member login = memberService.login(new Member(null, username, password, null));
//        if (login == null) {
//            System.out.println("登录失败，不存在该用户");
//            req.setAttribute("msg", "用户名或密码错误");
//            req.setAttribute("username", username);
//            req.getRequestDispatcher("/views/member/login.jsp").forward(req, resp);
//        } else {
//            System.out.println("登陆成功，该用户的用户名为：" + username + ";密码为：" + password);
//            req.getRequestDispatcher("/views/member/login_ok.jsp").forward(req, resp);
//        }
//    }
//}